YUI.add("app.lib.console", function(A) {

    A.namespace("app.lib.console");
    
    A.app.lib.console.Console = function() {
        var consoleArea = document.getElementById("console_area");
        this.consoleText = document.createElement("textarea");
        this.consoleText.className = "panel_console";
        this.consoleText.rows = 40;
        this.consoleText.cols = 80;
        consoleArea.appendChild(this.consoleText);
    };

    A.app.lib.console.Console.prototype = {
            
        consoleText : null,

        print : function(content) {
           this.consoleText.appendChild(document.createTextNode(content));
        },
        
        println : function(content) {
           this.print(content + "\r");
        },
        
        printHTML: function(contentHTML) {
           var content = contentHTML.replace(/&nbsp;/g, " ");
           content = content.replace(/<br\/>/g, "\r");
           content = content.replace(/(<code>|<\/code>)/g, "");
           this.print(content);
        }

    };
    
});